<?php
/*****************************************
Wer Wird Millionär
TIT10NS Webengeneering Projekt

resultnames - Seite um Gewinnstufen zu ändern

Autoren: Markus Schwarz
Copyright: 2012 DHBW Mannheim
*****************************************/
include ("inc/startup.php");
include ("inc/header.php");
require ("inc/TAdminView.php");
require ("inc/TAdminJoker.php");

if (isset($_POST['submitButton'])) {
	
	$jokers = new TAdminJoker(
		$_POST["TelSureLow"],
		$_POST["TelSureLowMed"],
		$_POST["TelSureMed"],
		$_POST["TelSureMedHigh"],
		$_POST["TelSureHigh"],
		$_POST["TelNoIdeaLow"],
		$_POST["TelNoIdeaLowMed"],
		$_POST["TelNoIdeaMed"],
		$_POST["TelNoIdeaMedHigh"],
		$_POST["TelNoIdeaHigh"],
		$_POST["AudLow"],
		$_POST["AudLowMed"],
		$_POST["AudMed"],
		$_POST["AudMedHigh"],
		$_POST["AudHigh"],
		$_POST["RiskLow"],
		$_POST["RiskLowMed"],
		$_POST["RiskMed"],
		$_POST["RiskMedHigh"],
		$_POST["RiskHigh"]);

	
	if ($jokers->checkCompleteness()) {
		if ($jokers->checkValue()) {
			TModel::setJokerPossibilities($jokers);
			$notification = new TAdminNotification ("success", "jokerFormSuccess");
		}
		else {
			$notification = new TAdminNotification ("error", "jokerFormRangeError");
		}
	}
	else {
		$notification = new TAdminNotification ("error", "jokerFormTextEmpty");
	}
	
	TAdminView::getJokerForm($notification, $jokers);
}
else {

	$notification = new TAdminNotification ("", "");
	TAdminView::getJokerForm($notification);

}

include ("inc/footer.php");
?>